/**
 * 项目名：	Rumba Plan
 * 
 * 版权所有(C)，上海海鼎信息工程股份有限公司，2007，所有权利保留。
 * 
 * 文件名：	BProfile.java
 * 模块说明：	
 * 修改历史：
 * Nov 13, 2007 - zhangyanbo - 创建。
 */
package com.hd123.rumba.user.biz;

import java.util.Date;

import com.hd123.rumba.exception.BusinessException;
import com.hd123.rumba.runtime.IPersistent;
import com.hd123.rumba.runtime.biz.BVersionedPersistent;
import com.hd123.rumba.user.IProfile;

/**
 * @author zhangyanbo
 * 
 */
public class BProfile extends BVersionedPersistent {

  private String email; // 电子邮件
  private String phoneHome; // 家庭电话
  private String phoneOffice; // 工作电话
  private String mobile; // 移动电话
  private String pager; // 寻呼机
  private String msn; // MSN
  private String qq; // QQ
  private String postcode; // 邮编
  private Date birthday; // 生日
  private Date wedding; // 结婚纪念日
  private String favoriteColor; // 喜好的颜色
  private String favoriteNumber; // 喜好的数字
  private Boolean married; // 已婚
  private String address1; // 地址一
  private String address2; // 地址二
  private String address3; // 地址三
  private String contactor; // 联系人
  private String phone; // 电话
  private String website; // 网址
  private String fax; // 传真
  private String position; // 职位

  public void readFrom(IPersistent source) throws BusinessException {
    super.readFrom(source);
    if (source instanceof IProfile) {
      IProfile po = (IProfile) source;
      this.email = po.getEmail();
      this.phoneHome = po.getPhoneHome();
      this.phoneOffice = po.getPhoneOffice();
      this.mobile = po.getMobile();
      this.pager = po.getPager();
      this.msn = po.getMsn();
      this.qq = po.getQq();
      this.postcode = po.getPostcode();
      this.birthday = po.getBirthday();
      this.wedding = po.getWedding();
      this.favoriteColor = po.getFavoriteColor();
      this.favoriteNumber = po.getFavoriteNumber();
      this.married = po.getMarried();
      this.address1 = po.getAddress1();
      this.address2 = po.getAddress2();
      this.address3 = po.getAddress3();
      this.contactor = po.getContactor();
      this.phone = po.getPhone();
      this.website = po.getWebsite();
      this.fax = po.getFax();
      this.position = po.getPosition();
    }
  }

  public void writeTo(IPersistent target) throws BusinessException {
    if (target instanceof IProfile) {
      IProfile po = (IProfile) target;
      po.setLastModified(this.lastModified);
      po.setEmail(this.email);
      po.setPhoneHome(this.phoneHome);
      po.setPhoneOffice(this.phoneOffice);
      po.setMobile(this.mobile);
      po.setPager(this.pager);
      po.setMsn(this.msn);
      po.setQq(this.qq);
      po.setPostcode(this.postcode);
      po.setBirthday(this.birthday);
      po.setWedding(this.wedding);
      po.setFavoriteColor(this.favoriteColor);
      po.setFavoriteNumber(this.favoriteNumber);
      po.setMarried(this.married);
      po.setAddress1(this.address1);
      po.setAddress2(this.address2);
      po.setAddress3(this.address3);
      po.setContactor(this.contactor);
      po.setPhone(this.phone);
      po.setWebsite(this.website);
      po.setFax(this.fax);
      po.setPosition(this.position);
    }
  }

  public String getAddress1() throws BusinessException {
    return address1;
  }

  public void setAddress1(String address1) throws BusinessException {
    this.address1 = address1;
  }

  public String getAddress2() throws BusinessException {
    return address2;
  }

  public void setAddress2(String address2) throws BusinessException {
    this.address2 = address2;
  }

  public String getAddress3() throws BusinessException {
    return address3;
  }

  public void setAddress3(String address3) throws BusinessException {
    this.address3 = address3;
  }

  public Date getBirthday() throws BusinessException {
    return birthday;
  }

  public void setBirthday(Date birthday) throws BusinessException {
    this.birthday = birthday;
  }

  public String getContactor() throws BusinessException {
    return contactor;
  }

  public void setContactor(String contactor) throws BusinessException {
    this.contactor = contactor;
  }

  public String getEmail() throws BusinessException {
    return email;
  }

  public void setEmail(String email) throws BusinessException {
    this.email = email;
  }

  public String getFavoriteColor() throws BusinessException {
    return favoriteColor;
  }

  public void setFavoriteColor(String favoriteColor) throws BusinessException {
    this.favoriteColor = favoriteColor;
  }

  public String getFavoriteNumber() throws BusinessException {
    return favoriteNumber;
  }

  public void setFavoriteNumber(String favoriteNumber) throws BusinessException {
    this.favoriteNumber = favoriteNumber;
  }

  public String getFax() throws BusinessException {
    return fax;
  }

  public void setFax(String fax) throws BusinessException {
    this.fax = fax;
  }

  public Boolean getMarried() throws BusinessException {
    return married;
  }

  public void setMarried(Boolean married) throws BusinessException {
    this.married = married;
  }

  public String getMobile() throws BusinessException {
    return mobile;
  }

  public void setMobile(String mobile) throws BusinessException {
    this.mobile = mobile;
  }

  public String getMsn() throws BusinessException {
    return msn;
  }

  public void setMsn(String msn) throws BusinessException {
    this.msn = msn;
  }

  public String getPager() throws BusinessException {
    return pager;
  }

  public void setPager(String pager) throws BusinessException {
    this.pager = pager;
  }

  public String getPhone() throws BusinessException {
    return phone;
  }

  public void setPhone(String phone) throws BusinessException {
    this.phone = phone;
  }

  public String getPhoneHome() throws BusinessException {
    return phoneHome;
  }

  public void setPhoneHome(String phoneHome) throws BusinessException {
    this.phoneHome = phoneHome;
  }

  public String getPhoneOffice() throws BusinessException {
    return phoneOffice;
  }

  public void setPhoneOffice(String phoneOffice) throws BusinessException {
    this.phoneOffice = phoneOffice;
  }

  public String getPosition() throws BusinessException {
    return position;
  }

  public void setPosition(String position) throws BusinessException {
    this.position = position;
  }

  public String getPostcode() throws BusinessException {
    return postcode;
  }

  public void setPostcode(String postcode) throws BusinessException {
    this.postcode = postcode;
  }

  public String getQq() throws BusinessException {
    return qq;
  }

  public void setQq(String qq) throws BusinessException {
    this.qq = qq;
  }

  public String getWebsite() throws BusinessException {
    return website;
  }

  public void setWebsite(String website) throws BusinessException {
    this.website = website;
  }

  public Date getWedding() throws BusinessException {
    return wedding;
  }

  public void setWedding(Date wedding) throws BusinessException {
    this.wedding = wedding;
  }
}
